package bing.web.view.pojo;

import java.io.Serializable;
import java.util.List;

public class PageBean<E> implements Serializable {

	private static final long serialVersionUID = 2L;

	private int pageSize = 3;//案例使用数值较小，生产环境中需要调大
	private int sumRows;
	private int pageCount;

	private List<E> dataList;

	public int getPageSize() {
		return pageSize;
	}

	public void setPageSize(int pageSize) {
		this.pageSize = pageSize;
	}

	public int getSumRows() {
		return sumRows;
	}

	public void setSumRows(int sumRows) {
		this.sumRows = sumRows;
	}

	public int getPageCount() {
		if (sumRows % pageSize == 0) {
			pageCount = sumRows / pageSize;
		} else {
			pageCount = sumRows / pageSize + 1;
		}
		return pageCount;
	}

	public void setPageCount(int pageCount) {
		this.pageCount = pageCount;
	}

	public List<E> getDataList() {
		return dataList;
	}

	public void setDataList(List<E> dataList) {
		this.dataList = dataList;
	}

}
